package com.tanhua.model.vo;

import com.tanhua.model.domain.Options;
import com.tanhua.model.domain.SoulQuestion;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * 测试问题vo
 *
 * @author 李磊
 * @since 2022-01-14 9:33
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SoulQuestionVo implements Serializable {
    /**
     * 试题编号
     */
    private String id;
    /**
     * 题目内容
     */
    private  String question;
    /**
     * 试题选项
     */
    private List<OptionsVo> options;

    public static SoulQuestionVo init(SoulQuestion soulQuestion, List<OptionsVo> options) {

        SoulQuestionVo vo = new SoulQuestionVo();
        vo.setId(soulQuestion.getId().toString());
        vo.setQuestion(soulQuestion.getQuestion());
        vo.setOptions(options);
        return vo;
    }

}
